package com.ophiux.pay.demo;

import cn.hutool.json.JSONUtil;

import java.util.ArrayList;
import java.util.List;


public class Test {

    public static void main(String[] args) {
        IntegerPrinter print = new IntegerPrinter(100);
        print.print();

        StringPrinter stringPrinter = new StringPrinter("2");
        stringPrinter.print();

        Printer<String> printer = new Printer<>("hello world");
        printer.print();

        VehiclePrinter<Bus> vehiclePrinter = new VehiclePrinter(new Bus());
        vehiclePrinter.print();



        VehiclePrinter2<Bicycle> vehiclePrinter2 = new VehiclePrinter2(new Bicycle());
        vehiclePrinter2.print();


        VehiclePrinter3<Aircraft> vehiclePrinter3 = new VehiclePrinter3(new Aircraft());
        vehiclePrinter3.print();

        List<Car> cars = new ArrayList<>();
        printList(cars);


    }

    public static void printList(List<? extends Car> list){
        System.out.println(JSONUtil.toJsonStr(list));
    }
}
